package com.xjl.javacore.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/** 注解的三种使用场景
 *
 * https://www.cnblogs.com/lenve/p/10748453.html
 *
 * Exception  异常处理类测试
 * @author xiaojinlu1990@163.com
 * @date 2020/1/22 14:55
 */
@RestController
@RequestMapping("/api")
public class TestController {

    /**
     *
     * @author xiaojinlu
     */
    @RequestMapping(value = "/xjl")
    public String xjl() {
        new RuntimeException();
        return "xjl";
    }

    /**
     *
     * @author xiaojinlu
     */
    @RequestMapping(value = "xjl1")
    public String xjl1() {
        new NullPointerException();
        return "xjl1";
    }
    /**
     *
     * @author xiaojinlu
     */
    @RequestMapping(value = "xjl2")
    public void xjl2() throws Exception {

            throw new Exception();
    }

}
